package demo.codeanalyzer.processor;

import com.sun.source.tree.ClassTree;
import com.sun.source.util.Trees;

public class NameSpacesClassPrinter implements ClassPrinter {

	private final ClassTree classTree;

	private final Trees trees;

	private final PrintingVisitor visitor;

	public NameSpacesClassPrinter(ClassTree classTree, Trees trees,
			PrintingVisitor visitor) {
		this.classTree = classTree;
		this.trees = trees;
		this.visitor = visitor;
	}

	public Object print() {
		System.out.println("<!DOCTYPE rdf:RDF [");
		System.out.println(namespaceString("xsd",
				"http://www.w3.org/2001/XMLSchema#"));
		System.out.println(namespaceString("rdf",
				"http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
		System.out.println(namespaceString("rdfs",
				"http://www.w3.org/2000/01/rdf-schema#"));
		System.out.println("]>");
		return visitor.visitParentClass(classTree, trees);
	}

	private String namespaceString(String nameSpaceIdentifier,
			String nameSpaceUri) {
		return String.format("<!ENTITY %s \"%s\" >", nameSpaceIdentifier,
				nameSpaceUri);
	}

	public ClassPrinter label() {
		// TODO Auto-generated method stub
		return null;
	}

	public ClassPrinter label(String string) {
		return this;
	}

}
